package com.usermanagement.dto;

import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
public class UserDTO {

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Length(min = 3, max = 255, message = "用户名长度应在3到255之间")
    @ApiModelProperty(value = "用户名")
    private String username;

    /**
     * 密码哈希
     */
    @NotBlank(message = "密码哈希不能为空")
    @Length(min = 60, max = 60, message = "密码哈希长度应为60")
    @ApiModelProperty(value = "密码哈希")
    private String passwordHash;

    /**
     * 电子邮件
     */
    @NotBlank(message = "电子邮件不能为空")
    @Email(message = "电子邮件格式不正确")
    @ApiModelProperty(value = "电子邮件")
    private String email;

    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID")
    private Integer roleId;

    /**
     * 身份ID
     */
    @ApiModelProperty(value = "身份ID")
    private Integer identityId;
}